package com.djmw.mouse.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.validator.constraints.NotBlank;
import org.hibernate.validator.constraints.Range;

@Entity
@Table(name = "t_company_department")
public class Department extends IdEntity {
	private Company company;
	private String name;
	private int order;

	public Department() {
	}

	@ManyToOne
	@JoinColumn(name = "c_company_id")
	public Company getCompany() {
		return company;
	}
	public void setCompany(Company company) {
		this.company = company;
	}

	@Range(min = 0)
	@Column(name = "c_order")
	public int getOrder() {
		return order;
	}
	public void setOrder(int order) {
		this.order = order;
	}

	@NotBlank
	@Column(name = "c_name")
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}

}
